﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace App1AppHandler
{
    public class ItemIDGenerator
    {
        private long ID = 0;
        private long CreatureID = 0;
        private long SpellID = 0;

        private object lockObject1 = new object();
        private object lockObject2 = new object();
        private object lockObject3 = new object();

        public ItemIDGenerator() { }

        public long GetUID()
        {
            lock (lockObject1)
            {
                ID = ID + 1;
                return ID;
            }
        }
        public long GetCreatureUID()
        {
            lock (lockObject2)
            {
                CreatureID = CreatureID + 1;
                return CreatureID;
            }
        }
        public long GetSpellID()
        {
            lock (lockObject3)
            {
                SpellID = SpellID + 1;
                return SpellID;
            }
        }
    }
}
